//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System;
using System.Reflection;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;

#if !NUNIT
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
using TestCleanup = NUnit.Framework.TearDownAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
#endif

namespace EntLibContrib.Resource.Configuration.Design.Tests
{
	[TestClass]
	public class ResourceManagerNodeFixture : ConfigurationDesignHost
	{
		DictionaryConfigurationSource configurationSource = new DictionaryConfigurationSource();

		protected override void InitializeCore ()
		{
			SetDictionaryConfigurationSource(configurationSource);
		}

		[TestMethod]
		[ExpectedException(typeof(ArgumentNullException))]
		public void PassingNullDataInResourceManagerNodeThrowsException ()
		{
			new ResourceManagerNode(null);
		}

		[TestMethod]
		public void ResourceManagerNodeTest ()
		{
			ResourceManagerNode node = new ResourceManagerNode();
			ResourceManagerData data = node.ResourceManagerData;

			Assert.AreEqual("Resource Manager", data.Name);
		}
	}
}
